package com.siemens.industrial.model.partner;

import org.springframework.jdbc.core.RowMapper;

import java.util.Date;

/**
 * Created by qupen on 2016/9/18.
 */
public class DeviceShiftRelation {
    private String startTime;
    private String endTime;
    private String shiftName;
    private String shiftLead;
    private String userId;
    private int plan;
    private Date beginDate;
    private Date endDate;
    private Date createTime;

    private static final RowMapper<DeviceShiftRelation> rowMapper = (resultSet, i) -> {
        DeviceShiftRelation deviceShiftRelation = new DeviceShiftRelation();
        deviceShiftRelation.setUserId(resultSet.getString("user_id"));
        deviceShiftRelation.setStartTime(resultSet.getString("start_time"));
        deviceShiftRelation.setEndTime(resultSet.getString("end_time"));
        deviceShiftRelation.setCreateTime(new Date(resultSet.getTimestamp("create_time").getTime()));
        return deviceShiftRelation;
    };

    public static RowMapper<DeviceShiftRelation> getRowMapper() {
        return rowMapper;
    }

    //<editor-fold desc="getters and setters">
    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getShiftName() {
        return shiftName;
    }

    public void setShiftName(String shiftName) {
        this.shiftName = shiftName;
    }

    public String getShiftLead() {
        return shiftLead;
    }

    public void setShiftLead(String shiftLead) {
        this.shiftLead = shiftLead;
    }

    public int getPlan() {
        return plan;
    }

    public void setPlan(int plan) {
        this.plan = plan;
    }

    public Date getBeginDate() {
        return beginDate;
    }

    public void setBeginDate(Date beginDate) {
        this.beginDate = beginDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    //</editor-fold>
}
